<?php

class CodeSpace_Language_View_Helper_Language extends Zend_View_Helper_Abstract
{

    protected $_language = 'undefined';
    
    protected $_options = array();
    
    public function language()
    {
        return $this;
    }
    
    public function setLanguage($language)
    {
        if($this->hasLanguage($language))
        {
            $this->_language = $language;
            return true;
        }else {
            return false;
        }
    }
    
    public function getLanguage()
    {
        return $this->_language;
    }
    
    public function getLanguages()
    {
        return $this->_options['language'];
    }
    
    public function setOptions($options)
    {
        $this->_options = $options;
    }
    
    public function hasLanguage($language)
    {
        if(in_array($language, $this->_options['language'])){
            return true;
        }else {
            return false;
        }
    }
    
}
